package zxn.circleboard.demo;

import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.widget.ImageView;

import androidx.appcompat.app.AppCompatActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

public class ShowActivity extends AppCompatActivity {

    @BindView(R.id.iv_show)
    ImageView ivShow;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_show);
        ButterKnife.bind(this);

        //Bitmap bitmap = (Bitmap) getIntent().getParcelableExtra("bp");
//        Bundle bundle = getIntent().getBundleExtra("bundle");
//        Bitmap bitmap = (Bitmap) bundle.getParcelable("bp");


        Bundle bundle = getIntent().getExtras();
        if (bundle != null) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
                ImageBinder imageBinder = (ImageBinder) bundle.getBinder("bitmap");
                Bitmap bitmap = imageBinder.getBitmap();
               // mTv.setText(String.format(("bitmap大小为%dkB"), bitmap.getByteCount() / 1024));
                ivShow.setImageBitmap(bitmap);
            }
        }
    }
}
